import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import List from '../views/List.vue'
import Detail from '../views/Detail.vue'

const routes = [
   { path: '/', name: 'home', component: Home },
   { path: '/list', name: 'list', component: List },
   // detail 使用动态参数并通过 props 传递
   { path: '/detail/:id', name: 'detail', component: Detail, props: true }
]

const router = createRouter({
   history: createWebHistory(), // 或 createWebHashHistory() 视项目需要
   routes
})

export default router
